/*
 * This file is part of Formin Media Library
 * 
 */
package formin.mediaLibrary.gui.components;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;
 


/**
 * 
 * 
 * @author formin
 *
 */
public class MediaTypePanel extends JPanel implements ActionListener {
	//==========================================================================
    // Static attributes
    //==========================================================================
	public static final String MEDIA_TYPE_TV = "TV";
	public static final String MEDIA_TYPE_MOVIES = "Movies";
	public static final String MEDIA_TYPE_MUSIC = "Music";
	public static final String MEDIA_TYPE_PICTURES = "Pictures";
	public static final String MEDIA_TYPE_SETTINGS = "Settings";
	//==========================================================================
    // Attributes
    //==========================================================================
	private JButton settingsButton;
	private JButton tvButton;
	private JButton movieButton;
	private JButton musicButton;
	private JButton pictureButton;
	
	private MainPanel mainRef;
    //==========================================================================
    // Constructors
    //==========================================================================
	public MediaTypePanel(MainPanel main){
		mainRef = main;
		//layout manager to stack items along the Y axis
		this.setLayout(new BoxLayout(this,BoxLayout.Y_AXIS));
		
		//create buttons
		settingsButton = new JButton(MEDIA_TYPE_SETTINGS);
		tvButton = new JButton(MEDIA_TYPE_TV);
		movieButton = new JButton(MEDIA_TYPE_MOVIES);
		musicButton = new JButton(MEDIA_TYPE_MUSIC);
		pictureButton = new JButton(MEDIA_TYPE_PICTURES);
		settingsButton.addActionListener(this);
		tvButton.addActionListener(this);
		movieButton.addActionListener(this);
		musicButton.addActionListener(this);
		pictureButton.addActionListener(this);
		
		
		//add buttons
		add(settingsButton);
		add(tvButton);
		add(movieButton);
		add(musicButton);
		add(pictureButton);
		
	}
    //==========================================================================
    // Getters
    //==========================================================================
	@Override
	public void actionPerformed(ActionEvent e) {
		mainRef.setDisplayDetail(e .getActionCommand());		
	}

    //==========================================================================
    // Setters
    //==========================================================================

    //==========================================================================
    // Inherited methods
    //==========================================================================

    //==========================================================================
    // Static methods
    //==========================================================================

}
